package com.yuanxiao.common.core.exception;

import lombok.Getter;
import com.yuanxiao.common.core.result.IResultCode;

/**
 * 自定义异常
 */
@Getter
public class RRException extends RuntimeException {
	private static final long serialVersionUID = 1L;
	
    private String msg;
    private int code = 500;

	public IResultCode resultCode;

	public RRException(IResultCode errorCode) {
		super(errorCode.getMsg());
		this.resultCode = errorCode;
	}
    
    public RRException(String msg) {
		super(msg);
		this.msg = msg;
	}
	
	public RRException(String msg, Throwable e) {
		super(msg, e);
		this.msg = msg;
	}
	
	public RRException(String msg, int code) {
		super(msg);
		this.msg = msg;
		this.code = code;
	}
	
	public RRException(String msg, int code, Throwable e) {
		super(msg, e);
		this.msg = msg;
		this.code = code;
	}
	
}
